package com.dubbo.consumer;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.api.DemoService;
import com.dubbo.api.User;
import org.springframework.stereotype.Component;

/**
 * Created by LiuChang on 2017/7/24/024.
 */
@Component
public class ConsumerTest {

    @Reference
    private DemoService demoService;

    public void test() {
        String hello = demoService.sayHello("ricky"); // 执行远程方法
        System.out.println(hello); // 显示调用结果

        User user = demoService.findUserById(15);
        System.out.println(user); // 显示调用结果
    }

}
